import React, { useMemo } from 'react';
import { useLocation } from 'react-router-dom';
import SoundRecordList from './components/SoundRecordList';
import './style.scss';

// node.js中querystring模块
import qs from 'query-string';
/**录音库 */
const SeatSoundLibrary: React.FC = () => {
  // 路由location
  const location = useLocation();
  // URL查询字符串=>对象
  const query = useMemo(() => {
    return qs.parse(location.search);
  }, [location.search]);
  const templateId = Number(query.templateId);

  return (
    <>
      <SoundRecordList templateId={templateId} />
    </>
  );
};
export default SeatSoundLibrary;
